/**
 * Created by Administrator on 2015/2/8 0008.
 */
var customerApp = angular.module("app.appInfo",[]);
customerApp.filter("dataFormat",function(){return function(input){return input.toString().substring(0,input.toString().lastIndexOf(":"));}});
//客户
customerApp.controller("appInfoIndex",['$scope','$http','ngDialog','$filter',function($scope,$http,ngDialog,$filter){
    var startDate;
    var endDate;
    $http.get('app/selectPage?pageNum=1').
    success(function(data) {
            $scope.appInfo =  data.list;
            $scope.total = data.total;
            $scope.pageSize = data.pageSize;
            $scope.numPerPage = 1;
        });
    $http.get('app/getCount').success(function(data) {$scope.count =  data.count;});
    $scope.pageChange = function(page){
        startDate = $("#start").val();endDate = $("#end").val();
        $http.get('app/selectPage',{params: {pageNum:page,startDate:startDate,endDate:endDate}}).
            success(function(data) {
                $scope.appInfo =  data.list;
                $scope.total = data.total;$scope.pageSize = data.pageSize;
            });
    };
    $scope.payOrder = function(rowName) {
        return $scope.row !== rowName ? ($scope.row = rowName,
            $scope.appInfo = $filter("orderBy")($scope.appInfo, rowName), $scope.onOrderChange()) : void 0
    };
}]);
